package com.mixsmart.core.test.service;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.mixsmart.core.service.impl.MgrService;
import com.mixsmart.core.test.entity.TUser;

@Service
public class UserService extends MgrService<TUser, String>{

	@Transactional(propagation=Propagation.REQUIRED,readOnly=false)
	public void saveTest() {
		TUser user = new TUser();
		user.setId("test-tr-1");
		user.setName("张三");
		user.setAge(20);
		user.setGender("男");
		save(user);
	}
	
	/**
	 * 
	 * @return
	 */
	public TUser findTest() {
		//return find(Cnd.where(Exp.eq("id", "test-tr-1")));
		return find("test-tr-1");
	}
	
}
